using Gtk;

namespace Atlantis
{
    public class OpenFileDialog : FileChooserDialog 
    {

        private string last_folder;

        public OpenFileDialog () 
        {
            this.title = "Open File";
            this.action = FileChooserAction.OPEN;

            add_button (STOCK_CANCEL, ResponseType.CANCEL);
            add_button (STOCK_OPEN, ResponseType.ACCEPT);
            set_default_response (ResponseType.ACCEPT);

            if (this.last_folder != null) 
            {
                set_current_folder (this.last_folder);
            }
        }

        public override void response (int type) 
        {
            if (type == ResponseType.ACCEPT) 
            {
                this.last_folder = get_current_folder ();
            }
        }
    }
}
